import java.util.Arrays;

public class Solution1103 {
    public int[] distributeCandies(int candies, int num_people) {
        int[] f=new int[num_people];
        int t=0;
        while (candies>0){
            t++;
            int m=Math.min(t,candies);
            f[(t-1)%num_people]+=m;
            candies-=m;
        }
        return f;
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(new Solution1103().distributeCandies(7, 4)));
    }
}
